package heima3_2.cn.osc.ui.main_fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import net.oschina.app.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.hdodenhof.circleimageview.CircleImageView;
import heima3_2.cn.osc.ui.activity.AttentionAndFansActivity;
import heima3_2.cn.osc.ui.activity.EasyTagActivity;
import heima3_2.cn.osc.ui.activity.MessageActivity;
import heima3_2.cn.osc.ui.activity.UserCollectActivity;

/**
 * Created by yaozhanlie on 2017/1/15.
 */

public class MeFragment extends Fragment {
    @Bind(R.id.item_headImage)
    CircleImageView mItemHeadImage;
    @Bind(R.id.iv_gender)
    CircleImageView mIvGender;
    @Bind(R.id.iv_qr_code)
    ImageView mIvQrCode;
    @Bind(R.id.tv_user_mark)
    TextView mTvUserMark;
    @Bind(R.id.ll_integral)
    LinearLayout mLlIntegral;
    @Bind(R.id.tv_user_collect)
    TextView mTvUserCollect;
    @Bind(R.id.ll_collect)
    LinearLayout mLlCollect;
    @Bind(R.id.tv_user_attention)
    TextView mTvUserAttention;
    @Bind(R.id.textView)
    TextView mTextView;
    @Bind(R.id.ll_attention)
    LinearLayout mLlAttention;
    @Bind(R.id.tv_user_fans)
    TextView mTvUserFans;
    @Bind(R.id.ll_fans)
    LinearLayout mLlFans;
    @Bind(R.id.ll_user_four_btn)
    LinearLayout mLlUserFourBtn;
    @Bind(R.id.ll_user_message)
    LinearLayout mLlUserMessage;
    @Bind(R.id.ll_user_blog)
    LinearLayout mLlUserBlog;
    @Bind(R.id.ll_user_note)
    LinearLayout mLlUserNote;
    @Bind(R.id.ll_user_team)
    LinearLayout mLlUserTeam;
    @Bind(R.id.tv_easy_tag)
    TextView mTvEasyTag;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_me, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {

    }


    @OnClick({R.id.item_headImage, R.id.iv_gender, R.id.iv_qr_code, R.id.tv_user_mark, R.id.ll_integral, R.id.tv_user_collect, R.id.ll_collect, R.id.ll_attention, R.id.ll_fans, R.id.ll_user_message,R.id.tv_easy_tag})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.item_headImage:

                break;
            case R.id.iv_gender:
                break;
            case R.id.iv_qr_code:
                break;
            case R.id.tv_user_mark:
                break;
            case R.id.ll_integral:
                Toast.makeText(getContext(), "积分为无穷大", Toast.LENGTH_SHORT).show();
                break;
            case R.id.tv_user_collect:
                break;
            case R.id.ll_collect:
                Intent intent = new Intent(getActivity(), UserCollectActivity.class);
                getActivity().startActivity(intent);
                break;
            case R.id.ll_attention:
                Intent intent1 = new Intent(getActivity(), AttentionAndFansActivity.class);
                getActivity().startActivity(intent1);
                break;
            case R.id.ll_fans:
                Intent intent2 = new Intent(getActivity(), AttentionAndFansActivity.class);
                getActivity().startActivity(intent2);
                break;
            case R.id.ll_user_message:
                Intent intent3 = new Intent(getActivity(), MessageActivity.class);
                getActivity().startActivity(intent3);
                break;
            case R.id.tv_easy_tag:
                Intent intent4 = new Intent(getActivity(),EasyTagActivity.class);
                getActivity().startActivity(intent4);
                break;
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
